package cn.itcast.dagger2demo;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Administrator on 2016/8/2.
 */
@Module
public class ActivityModule {

    private MainActivity mainActivity;

    public ActivityModule(MainActivity mainActivity) {
        this.mainActivity = mainActivity;
    }

    @Provides
    public MainActivity provideMainActivity() {

        return mainActivity;
    }

   /* @Provides
    public User provideUser() {

        return new User("user from ActivityModule");
    }
*/
    @Provides
    public DaggerPrecenter provideDaggerPrecenter(MainActivity mainActivity, User user) {

        return new DaggerPrecenter(mainActivity, user);
    }

}
